#ifndef NANE_OPENALAPI_H
#   define  NANE_OPENALAPI_H

#   include "nane/core/crt/DynamicModule.h"

#   define AL_NO_PROTOTYPES
#   include "nane/SoundSystem/OAL/al.h"
#   include "nane/SoundSystem/OAL/alc.h"

namespace nane
{
    struct OpenALAPI
    {
        static bool                     valid;
        static ModuleHandle*            hModule;
        static LPALENABLE               alEnable;
        static LPALDISABLE              alDisable;
        static LPALISENABLED            alIsEnabled;
        static LPALGETBOOLEAN           alGetBoolean;
        static LPALGETINTEGER           alGetInteger;
        static LPALGETFLOAT             alGetFloat;
        static LPALGETDOUBLE            alGetDouble;
        static LPALGETBOOLEANV          alGetBooleanv;
        static LPALGETINTEGERV          alGetIntegerv;
        static LPALGETFLOATV            alGetFloatv;
        static LPALGETDOUBLEV           alGetDoublev;
        static LPALGETSTRING            alGetString;
        static LPALGETERROR             alGetError;
        static LPALISEXTENSIONPRESENT   alIsExtensionPresent;
        static LPALGETPROCADDRESS       alGetProcAddress;
        static LPALGETENUMVALUE         alGetEnumValue;
        static LPALLISTENERI            alListeneri;
        static LPALLISTENERF            alListenerf;
        static LPALLISTENER3F           alListener3f;
        static LPALLISTENERFV           alListenerfv;
        static LPALGETLISTENERI         alGetListeneri;
        static LPALGETLISTENERF         alGetListenerf;
        static LPALGETLISTENER3F        alGetListener3f;
        static LPALGETLISTENERFV        alGetListenerfv;
        static LPALGENSOURCES           alGenSources;
        static LPALDELETESOURCES        alDeleteSources;
        static LPALISSOURCE             alIsSource;
        static LPALSOURCEI              alSourcei;
        static LPALSOURCEF              alSourcef;
        static LPALSOURCE3F             alSource3f;
        static LPALSOURCEFV             alSourcefv;
        static LPALGETSOURCEI           alGetSourcei;
        static LPALGETSOURCEF           alGetSourcef;
        static LPALGETSOURCEFV          alGetSourcefv;
        static LPALSOURCEPLAYV          alSourcePlayv;
        static LPALSOURCESTOPV          alSourceStopv;
        static LPALSOURCEREWINDV        alSourceRewindv;
        static LPALSOURCEPLAY           alSourcePlay;
        static LPALSOURCEPAUSE          alSourcePause;
        static LPALSOURCESTOP           alSourceStop;
        static LPALSOURCEREWIND         alSourceRewind;
        static LPALGENBUFFERS           alGenBuffers;
        static LPALDELETEBUFFERS        alDeleteBuffers;
        static LPALISBUFFER             alIsBuffer;
        static LPALBUFFERDATA           alBufferData;
        static LPALGETBUFFERI           alGetBufferi;
        static LPALGETBUFFERF           alGetBufferf;
        static LPALSOURCEQUEUEBUFFERS   alSourceQueueBuffers;
        static LPALSOURCEUNQUEUEBUFFERS	alSourceUnqueueBuffers;
        static LPALDISTANCEMODEL        alDistanceModel;
        static LPALDOPPLERFACTOR        alDopplerFactor;
        static LPALDOPPLERVELOCITY      alDopplerVelocity;
        static LPALCGETSTRING           alcGetString;
        static LPALCGETINTEGERV         alcGetIntegerv;
        static LPALCOPENDEVICE          alcOpenDevice;
        static LPALCCLOSEDEVICE         alcCloseDevice;
        static LPALCCREATECONTEXT       alcCreateContext;
        static LPALCMAKECONTEXTCURRENT  alcMakeContextCurrent;
        static LPALCPROCESSCONTEXT      alcProcessContext;
        static LPALCGETCURRENTCONTEXT   alcGetCurrentContext;
        static LPALCGETCONTEXTSDEVICE   alcGetContextsDevice;
        static LPALCSUSPENDCONTEXT      alcSuspendContext;
        static LPALCDESTROYCONTEXT      alcDestroyContext;
        static LPALCGETERROR            alcGetError;
        static LPALCISEXTENSIONPRESENT  alcIsExtensionPresent;
        static LPALCGETPROCADDRESS      alcGetProcAddress;
        static LPALCGETENUMVALUE        alcGetEnumValue;
    };

    bool InitializeOpenALAPI( const char* _moduleName );
    void ReleaseOpenALAPI();
    void CheckForOpenALError();

}   // namespace nane

#endif	// NANE_OPENALAPI_H
